package org.lyy.service.impl;

import org.lyy.dao.ProductInfoDao;
import org.lyy.entity.ProductInfo;
import org.lyy.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service("ProductService")
public class ProductServiceImpl implements ProductService {

    @Autowired
    private ProductInfoDao dao;

    @Override
    public List<ProductInfo> findOne(String productId) {
        //return repository.findOne(productId);
        return dao.findOne(productId);
    }

    @Override
    public List<ProductInfo> findUpAll() {
        return dao.queryAll();
    }

    @Override
    public void save(ProductInfo productInfo) {
        dao.insertProduct(productInfo);
    }

    @Override
    public int update(ProductInfo productInfo){
        return dao.update(productInfo);
    }

    @Override
    public void insertProduct(ProductInfo productInfo){
         dao.insertProduct(productInfo);
    }

    @Override
    public void deleteProduct(String productId){
        dao.delete(productId);
    }

    @Override
    public List<ProductInfo> selectStatus(String productInfo){
        return dao.selectStatus(productInfo);
    }

    @Override
    public List<ProductInfo> selectKind(String productKind){
        return dao.selectKind(productKind);
    }
}
